<template>
  <div id="app" class="view-process" ref="viewProcessRef">
    <van-nav-bar left-arrow left-text="返回扫码" title="过程查看" @click-left="backToIndexFn">
      <template slot="right">
        <van-button class="van-button-nav" style="margin-right:15px;" plain type="primary" @click="showCraftPopFn">查品号</van-button>
        <van-button class="van-button-nav" plain type="info" @click="viewByTaskFn">查本次</van-button>
      </template>
    </van-nav-bar>

    <!-- 织造工艺单表格 -->
    <div style="padding: 15px; height:92%;">
      <div>
        <van-row class="craft-row first" type="flex" justify="space-between" align="center">
          <van-col class="craft-row-col title dateTime"><span>创建时间</span></van-col>
          <van-col class="craft-row-col title"><span>品名</span></van-col>
          <van-col class="craft-row-col title colorNo"><span>颜色</span></van-col>
          <van-col class="craft-row-col title number"><span>盘头号</span></van-col>
          <van-col class="craft-row-col title number"><span>匹数</span></van-col>
          <van-col class="craft-row-col title number"><span>匹长</span></van-col>
          <van-col class="craft-row-col title number"><span>织机号</span></van-col>
        </van-row>
      </div>
      <div style="max-height: 94%; overflow: auto">
        <van-row class="craft-row" :class="{ selected: curCraftRowIndex === index }" type="flex" justify="space-between" align="center" v-for="(row, index) in craftData" :key="row.id" @click="selectCraftRowFn(row, index)">
          <van-col class="craft-row-col dateTime">
            <span> {{ row.createAt ? row.createAt : "&nbsp;" }}</span>
          </van-col>
          <van-col class="craft-row-col">
            <span> {{ row.designNo ? row.designNo : "&nbsp;"  }}</span>
          </van-col>
          <van-col class="craft-row-col colorNo">
            <span> {{ row.colorNo ? row.colorNo : "&nbsp;" }}</span>
          </van-col>
          <van-col class="craft-row-col number">
            <span> {{ row.craftNo ? row.craftNo : "&nbsp;" }}</span>
          </van-col>
          <van-col class="craft-row-col number">
            <span> {{ row.craftNum ? row.craftNum : "&nbsp;" }}</span>
          </van-col>
          <van-col class="craft-row-col number">
            <span> {{ row.craftSingle ? row.craftSingle : "&nbsp;" }}</span>
          </van-col>
          <van-col class="craft-row-col number">
            <span> {{ row.loomNo ? row.loomNo : "&nbsp;" }}</span>
          </van-col>
        </van-row>
      </div>
    </div>


    <!-- 工艺查询弹窗 -->
    <van-popup  round  v-model="showCraftPop" :close-on-click-overlay="false" class="login-popup__filter" :closeable="true">
      <van-row style="margin: 50px 30px 30px 30px">
        <van-col>
          <van-field label="品名:" size="large" label-align="right" type="tel" clearable clear-trigger="always" v-model="craftNameParam" placeholder="输入品名"/>
        </van-col>
      </van-row>
      <van-row style="margin: 0px 30px 30px 30px">
        <van-col>
          <van-field
              size="large"
              v-model="startDateParam"
              style="font-size: 36px"
              label="开始时间:"
              label-align="right"
              readonly
              placeholder="点击选择时间"
              @click="showDatePickerFn('start')"
          />
        </van-col>
      </van-row>
      <van-row style="margin: 0px 30px 30px 30px">
        <van-col>
          <van-field
              size="large"
              v-model="endDateParam"
              label="结束时间:"
              label-align="right"
              readonly
              placeholder="点击选择时间"
              @click="showDatePickerFn('end')"
          />
        </van-col>
      </van-row>
      <van-row gutter="50">
        <van-col offset="4">
          <van-button plain style="font-size: 18px; height: 35px;" type="primary" @click="onClickScan($event, 1)">扫码查看</van-button>
        </van-col>
        <van-col>
          <van-button plain style="font-size: 18px; height: 35px;" type="info" @click="queryNewest4CraftFn">直接查看</van-button>
        </van-col>
      </van-row>
    </van-popup>
    <van-calendar v-model="showDatePicker" :min-date="minDateFilter" type="single" @confirm="confirmDateFilterFn" />

    <!-- 环节遮罩列表 -->
    <van-overlay z-index="2003" :show="showStepOverlay" :lock-scroll="false">
      <template>
        <div style="margin: 15px; height: 96%; background-color: white;">
          <div style="padding: 5px 5px 0px 5px;">
            <van-row class="craft-row first" type="flex" justify="space-between" align="center">
              <van-col class="craft-row-col title dateTime"><span>到达时间</span></van-col>
              <van-col class="craft-row-col title dateTime"><span>操作时间</span></van-col>
              <van-col class="craft-row-col title"><span>环节名称</span></van-col>
              <van-col class="craft-row-col title optName"><span>操作人</span></van-col>
            </van-row>
          </div>
          <div style="padding: 0px 5px 5px 5px; height: 85%; overflow: auto">
            <van-row class="craft-row" :class="{ selected: curStepRowIndex === index }" type="flex" justify="space-between" align="center" v-for="(row, index) in stepData" :key="row.id" @click="selectStepRowFn(row, index)">
              <van-col class="craft-row-col dateTime">
                <span> {{ row.createAt ? row.createAt : "&nbsp;" }}</span>
              </van-col>
              <van-col class="craft-row-col dateTime">
                <span> {{ row.finishAt ? row.finishAt : "&nbsp;"  }}</span>
              </van-col>
              <van-col class="craft-row-col stepName">
                <span> {{ row.stepName ? row.stepName : "&nbsp;" }}</span>
              </van-col>
              <van-col class="craft-row-col operatorName">
                <span> {{ row.operatorName ? row.operatorName : "&nbsp;" }}</span>
              </van-col>
            </van-row>
          </div>
          <div style="display: flex; justify-content: center; align-items: center; padding-top: 10px;">
            <van-button type="warning" style="width: 300px; font-size: 28px;" @click="closeStepOverlayFn">关闭</van-button>
          </div>
        </div>
      </template>
    </van-overlay>

    <!-- 操作数据遮罩列表 -->
    <van-overlay z-index="2004" :show="showOptOverlay" :lock-scroll="false">
      <template>
        <div style="margin: 15px; height: 96%; background-color: white;">
          <div style="padding: 5px 5px 0px 5px;">
            <van-row class="craft-row first" type="flex" justify="space-between" align="center">
              <van-col class="craft-row-col title opt"><span>数据类型</span></van-col>
              <van-col class="craft-row-col title"><span>数据名成</span></van-col>
              <van-col class="craft-row-col title"><span>参考值</span></van-col>
              <van-col class="craft-row-col title"><span>操作值</span></van-col>
            </van-row>
          </div>
          <div style="padding: 0px 5px 5px 5px; height: 85%; overflow: auto">
            <van-row class="craft-row" type="flex" justify="space-between" align="center" v-for="row in optData" :key="row.id">
              <van-col class="craft-row-col opt">
                <span> {{ row.opt ? row.opt == 1 ? "输入": row.opt == 2 ? "确认" : row.opt == 3 ? "图片上传" : row.opt == 4 ? "对象数组" : row.opt == 5 ? "对象" : row.opt == 9 ? "操作员工" : "&nbsp;" : "&nbsp;" }}</span>
              </van-col>
              <van-col class="craft-row-col">
                <span v-html="row.label ? row.label : '&nbsp;'"> </span>
              </van-col>
              <van-col class="craft-row-col">
                <span> {{ row.originalValue ? row.originalValue : "&nbsp;" }}</span>
              </van-col>
              <van-col class="craft-row-col">
                <span> {{ row.value ? row.value : "&nbsp;" }}</span>
              </van-col>
            </van-row>
          </div>
          <div style="display: flex; justify-content: center; align-items: center; padding-top: 10px;">
            <van-button type="warning" style="width: 300px; font-size: 28px;" @click="closeOptOverlayFn">关闭</van-button>
          </div>
        </div>
      </template>
    </van-overlay>

    <!-- 落布数据列表 -->
    <van-overlay z-index="2004" :show="showGreClothOverlay" :lock-scroll="false">
      <template>
        <div style="width: 100%; height: 96%; overflow-x: auto">
          <div style="margin: 15px; width: 130%; height: 100%; background-color: white;">
            <div style="padding: 5px 5px 0px 5px;">
              <van-row class="craft-row first" type="flex" justify="space-between" align="center">
                <van-col class="craft-row-col title"><span>品名</span></van-col>
                <van-col class="craft-row-col title colorNo"><span>颜色</span></van-col>
                <van-col class="craft-row-col title number"><span>匹号</span></van-col>
                <van-col class="craft-row-col title number"><span>顺序号</span></van-col>
                <van-col class="craft-row-col title number"><span>重量</span></van-col>
                <van-col class="craft-row-col title number"><span>长度</span></van-col>
                <van-col class="craft-row-col title userName"><span>落布人</span></van-col>
                <van-col class="craft-row-col title dateTime"><span>落布时间</span></van-col>
                <van-col class="craft-row-col title userName"><span>验布人</span></van-col>
                <van-col class="craft-row-col title dateTime"><span>验布时间</span></van-col>
                <van-col class="craft-row-col title userName"><span>修布人</span></van-col>
                <van-col class="craft-row-col title dateTime"><span>修布时间</span></van-col>
              </van-row>
            </div>
            <div style="padding: 0px 5px 5px 5px; height: 85%; overflow: auto">
              <van-row class="craft-row" type="flex" justify="space-between" align="center" v-for="row in greyClothData" :key="row.id">
                <van-col class="craft-row-col">
                  <span v-html="row.designNo ? row.designNo : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col colorNo">
                  <span v-html="row.colorNo ? row.colorNo : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col number">
                  <span v-html="row.designSeqNo ? row.designSeqNo : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col number">
                  <span v-html="row.no ? row.no : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col number">
                  <span v-html="row.weight ? row.weight : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col number">
                  <span v-html="row.length ? row.length : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col userName">
                  <span v-html="row.receiverName ? row.receiverName : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col dateTime">
                  <span v-html="row.receiveAt ? row.receiveAt : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col userName">
                  <span v-html="row.inspectorName ? row.inspectorName : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col dateTime">
                  <span v-html="row.inspectAt ? row.inspectAt : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col userName">
                  <span v-html="row.repairerName ? row.repairerName : '&nbsp;'"> </span>
                </van-col>
                <van-col class="craft-row-col dateTime">
                  <span v-html="row.repairAt ? row.repairAt : '&nbsp;'"> </span>
                </van-col>
              </van-row>
            </div>
            <div style="display: flex; justify-content: center; align-items: center; padding-top: 10px;">
              <van-button type="warning" style="width: 300px; font-size: 28px;" @click="closeGreyClothOverlayFn">关闭</van-button>
            </div>
          </div>
        </div>
      </template>
    </van-overlay>
  </div>
</template>

<script>
import { randomStr, openWin } from "@/utils/index";
import dayjs from "dayjs";
import {
  loadCraftByDesign,
  loadCraftById,
  loadCraftByTask,
  loadGreyCloth, loadGreyClothByCraft,
  loadOptDataByStep,
  loadTaskStepList
} from "@/views/process/main";
export default {
  name: "viewProcess",
  data() {
    return {
      /* 扫码枪处理 */
      intervalFlag: false,
      code: "",
      lastTime: "",
      nextTime: "",
      lastCode: "",
      nextCode: "",

      /* 弹窗筛选框参数 */
      scanFlag: false,
      optType: 0,   //扫码操作: 1-查品号 2-查本次
      showCraftPop: false,
      craftNameParam: "",
      calendarField: "",
      startDateParam: "",
      endDateParam: "",
      showDatePicker: false,
      minDateFilter: new Date(2022, 0, 31),

      /* 织造工艺列表 */
      curCraftRowIndex: -1,
      /*craftData: [{
        "createAt": "2022-06-26 16:19:20",
        "lonParameter": "54,54,38,70",
        "palmThreadWay": 2,
        "num": 510,
        "checker": "",
        "rightArrange": "",
        "fixWarp": 0,
        "total": 34170,
        "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
        "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
        "leftArrange": "",
        "craftRequire": "",
        "loomNo": "",
        "craftNo": "17",
        "planId": 1423,
        "id": 3579,
        "latParameter": "57,37,47,67",
        "drift": 0.0,
        "designNo": "05851-圭-13-毛圈布",
        "designFormId": 400,
        "planer": "施华",
        "lonKnotWidth": 0.0,
        "optType": 1,
        "lonKnotNum": 0.0,
        "single": 67,
        "alternateNum": 10,
        "lonNoKnotNum": 0,
        "craftNum": 30,
        "craftSingle": 72,
        "lonSpindleNum": 0,
        "taskId": 35140,
        "status": 2
      },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "16",
          "planId": 1423,
          "id": 3575,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35139,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "15",
          "planId": 1423,
          "id": 3574,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35138,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "14",
          "planId": 1423,
          "id": 3573,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35137,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "13",
          "planId": 1423,
          "id": 3572,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35136,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "12",
          "planId": 1423,
          "id": 3571,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35135,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "11",
          "planId": 1423,
          "id": 3570,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35134,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "10",
          "planId": 1423,
          "id": 3569,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35133,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3568,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },{
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3576,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3577,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3578,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },{
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3580,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },{
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3581,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },{
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3582,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },{
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3583,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },{
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3584,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },{
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "9",
          "planId": 1423,
          "id": 3585,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35132,
          "status": 2
        },
        {
          "lonParameter": "54,54,38,70",
          "palmThreadWay": 2,
          "num": 510,
          "checker": "",
          "rightArrange": "",
          "fixWarp": 0,
          "total": 34170,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker",
          "arrange": "<p>边：&nbsp;左右24根&nbsp;4入&nbsp;穿9&nbsp;9&nbsp;10&nbsp;10&nbsp;地：1.2.1.2&nbsp;3.4.3.4&nbsp;5.6.5.6&nbsp;7.8.7.8&nbsp;共计16根</p>",
          "leftArrange": "",
          "craftRequire": "",
          "loomNo": "",
          "craftNo": "8",
          "planId": 1423,
          "id": 3567,
          "latParameter": "57,37,47,67",
          "drift": 0.0,
          "designNo": "05851-圭-13-毛圈布",
          "designFormId": 400,
          "planer": "施华",
          "lonKnotWidth": 0.0,
          "optType": 1,
          "lonKnotNum": 0.0,
          "single": 67,
          "alternateNum": 10,
          "lonNoKnotNum": 0,
          "craftNum": 30,
          "craftSingle": 72,
          "lonSpindleNum": 0,
          "taskId": 35131,
          "status": 2
        }],*/
      craftData: [],

      /* 操作环节列表 */
      curStepRowIndex: -1,
      showStepOverlay: false,
      /*stepData: [{
        "stepType": 2,
        "stepName": "落坯布子流程",
        "operatorNo": "10087",
        "id": 195287,
        "resId": 3777,
        "operatorName": "董娟",
        "taskId": 36911,
        "createAt": "2022-06-26 16:21:20",
        "status": 2
      },
        {
          "stepType": 1,
          "stepName": "工艺组长核对",
          "operatorNo": "10087",
          "id": 195286,
          "resId": 3777,
          "operatorName": "董娟",
          "taskId": 36911,
          "createAt": "2022-06-26 16:19:20",
          "finishAt": "2022-06-26 16:21:20",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "剪布克重报工",
          "operatorNo": "10089",
          "id": 195285,
          "resId": 3777,
          "operatorName": "王黎伟",
          "taskId": 36911,
          "createAt": "2022-06-26 16:18:12",
          "finishAt": "2022-06-26 16:19:20",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "工艺核对报工",
          "operatorNo": "10089",
          "id": 195284,
          "resId": 3777,
          "operatorName": "王黎伟",
          "taskId": 36911,
          "createAt": "2022-06-26 16:17:48",
          "finishAt": "2022-06-26 16:18:12",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "纱线核对报工",
          "operatorNo": "10089",
          "id": 195283,
          "resId": 3777,
          "operatorName": "王黎伟",
          "taskId": 36911,
          "createAt": "2022-06-26 16:17:29",
          "finishAt": "2022-06-26 16:17:48",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "插片报工",
          "operatorNo": "10089",
          "id": 194852,
          "resId": 3777,
          "operatorName": "王黎伟",
          "taskId": 36911,
          "createAt": "2022-06-26 01:35:03",
          "finishAt": "2022-06-26 16:17:29",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "上轴报工",
          "operatorNo": "10086",
          "id": 194850,
          "resId": 3777,
          "operatorName": "杨改献",
          "taskId": 36911,
          "createAt": "2022-06-26 01:34:49",
          "finishAt": "2022-06-26 01:35:03",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "分配织机",
          "operatorNo": "10086",
          "id": 194847,
          "resId": 3777,
          "operatorName": "杨改献",
          "taskId": 36911,
          "createAt": "2022-06-26 01:34:29",
          "finishAt": "2022-06-26 01:34:49",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "清理报工",
          "operatorNo": "10175",
          "id": 194844,
          "resId": 3777,
          "operatorName": "朱玉玲",
          "taskId": 36911,
          "createAt": "2022-06-26 01:29:59",
          "finishAt": "2022-06-26 01:34:29",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 194803,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294811,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294810,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294809,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294808,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 194807,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294806,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294805,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294804,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294821,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294822,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        },
        {
          "stepType": 1,
          "stepName": "穿棕报工",
          "operatorNo": "10132",
          "id": 294823,
          "resId": 3777,
          "operatorName": "杨慧月",
          "taskId": 36911,
          "createAt": "2022-06-26 00:58:06",
          "finishAt": "2022-06-26 01:29:59",
          "status": 3
        }],*/
      stepData: [],

      /* 操作数据列表 */
      showOptOverlay: false,
      /*optData: [
        {"opt":2,"label":"总经根数","value":"true","field":"totalLonNum","originalValue":"3348"},
        {"opt":1,"label":"位移","value":"1.85","field":"drift"},
        {"opt":1,"label":"筒只数","value":"288","field":"lonSpindleNum"},
        {"opt":1,"label":"结数","value":"12","field":"lonKnotNum"},
        {"opt":1,"label":"结阔","value":"156.6","field":"lonKnotWidth"},
        {"opt":1,"label":"末结","value":"-108","field":"lonNoKnotNum"},
        {"opt":2,"label":"匹长","value":"true","field":"craftSingle","originalValue":"73"},
        {"opt":2,"label":"匹数","value":"true","field":"craftNum","originalValue":"28"},
        {"opt":2,"label":"经纱排列","field":"yarnLonArrangeView","originalValue":"1A"},
        {"opt":1,"label":"机台号","value":"1","field":"machineNum"},
        {"opt":1,"label":"操作备注","value":"无","field":"remark"},
        {"opt":2,"label":"A&nbsp;&nbsp;毛化纤&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0999#本白&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;21/1","value":"true","field":"","originalValue":""},
        {"opt":9,"label":"10073 陶永斌","value":"true","field":"77","originalValue":"100"},
        {"opt":2,"label":"总经根数","value":"true","field":"totalLonNum","originalValue":"3348"},
        {"opt":1,"label":"位移","value":"1.85","field":"drift"},
        {"opt":1,"label":"筒只数","value":"288","field":"lonSpindleNum"},
        {"opt":1,"label":"结数","value":"12","field":"lonKnotNum"},
        {"opt":1,"label":"结阔","value":"156.6","field":"lonKnotWidth"},
        {"opt":1,"label":"末结","value":"-108","field":"lonNoKnotNum"},
        {"opt":2,"label":"匹长","value":"true","field":"craftSingle","originalValue":"73"},
        {"opt":2,"label":"匹数","value":"true","field":"craftNum","originalValue":"28"},
        {"opt":2,"label":"经纱排列","field":"yarnLonArrangeView","originalValue":"1A"},
        {"opt":1,"label":"机台号","value":"1","field":"machineNum"},
        {"opt":1,"label":"操作备注","value":"无","field":"remark"},
        {"opt":2,"label":"A&nbsp;&nbsp;毛化纤&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0999#本白&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;21/1","value":"true","field":"","originalValue":""},
        {"opt":9,"label":"10073 陶永斌","value":"true","field":"77","originalValue":"100"}
      ],*/
      optData: [],

      /* 坯布列表 */
      showGreClothOverlay: false,
      /*greyClothData: [{
        "no": 0,
        "craftId": 3783,
        "printFlag": 0,
        "stepId": 0,
        "length": 0.0,
        "weight": 0.0,
        "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
        "planNo": 0,
        "craftNo": "3",
        "planId": 1505,
        "id": 42942,
        "taskId": 0,
        "designNo": "12128-透孔格"
      },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42943,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42944,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42945,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42946,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42947,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42948,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42949,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42950,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42951,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 42952,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 52953,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 52954,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 52955,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 52956,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 52957,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 52958,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 52959,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 529510,
          "taskId": 0,
          "designNo": "12128-透孔格"
        },
        {
          "no": 0,
          "craftId": 3783,
          "printFlag": 0,
          "stepId": 0,
          "length": 0.0,
          "weight": 0.0,
          "qrCode": "http://223.112.99.230:31087/task_step/list_to_do_4_worker_from_res",
          "planNo": 0,
          "craftNo": "3",
          "planId": 1505,
          "id": 529511,
          "taskId": 0,
          "designNo": "12128-透孔格"
        }]*/
      greyClothData: []
    }
  },
  watch: {
    intervalFlag() {
      const that = this;
      setTimeout(() => {
        that.intervalFlag = false;
      }, 2000);
    }
  },
  mounted() {
    let that = this;
    if (process.env.NODE_ENV === "production") {
      that.$nextTick(() => {
        that.initFn(that);
      });
    } else {
      window.apiready = () => {
        that.initFn(that);
      }
    }
  },
  methods: {
    initFn(that) {
      // 监听页面消失的时候，关掉页面就可以了
      window.api.addEventListener({
        name: "viewdisappear",
      }, function () {
        window.removeEventListener("keydown", that.onClickKeydown);
        window.api.closeWin();
      });
    },
    backToIndexFn() {
      openWin("index");
    },


    //查看品号 展示筛选
    showCraftPopFn() {
      this.showCraftPop = true;
      this.optType = 1;
      if(!this.startDateParam) {
        this.startDateParam = dayjs().subtract(1, "day").format("YYYY-MM-DD");
      }
      if(!this.endDateParam) {
        this.endDateParam = dayjs().format("YYYY-MM-DD");
      }
    },
    //查看本次
    viewByTaskFn() {
      window.removeEventListener("keydown", this.onClickKeydown);
      window.addEventListener("keydown", this.onClickKeydown);
      this.optType = 2;
      this.$toast({
        type: "loading",
        message: "请扫码",
        forbidClick: true,
        duration: 3000,
      });
    },
    //展示日历并标记
    showDatePickerFn(field) {
      this.showDatePicker = true;
      this.calendarField = field;
    },
    //确认选中日历区间
    confirmDateFilterFn(date) {
      this.showDatePicker = false;
      if(this.calendarField === "start") {
        this.startDateParam = dayjs(date).format("YYYY-MM-DD");
      } else if(this.calendarField === "end") {
        this.endDateParam = dayjs(date).format("YYYY-MM-DD");
      }
    },
    // 扫码
    onClickScan(e, optType) {
      this.scanFlag = true;
      this.optType = optType;
      e.target.blur();    //必须移除焦点 否者扫码台回车后又按下按钮
      this.onWatchEnter();
      this.$toast({
        type: "loading",
        message: "请扫码",
        forbidClick: true,
        duration: 20000,
      });
    },
    // 监听扫码时间
    onWatchEnter() {
      this.code = "";
      this.lastTime = "";
      this.nextTime = "";
      this.lastCode = "";
      this.nextCode = "";
      window.addEventListener("keydown", this.onClickKeydown);
    },
    // 监听事件
    onClickKeydown(e) {
      const that = this;
      that.$toast.clear();
      const Toast = that.$toast({
        type: "loading",
        message: "二维码解析中",
        forbidClick: true,
        duration: 20000,
      });
      if (window.event) {
        // IE
        that.nextCode = e.keyCode;
      } else if (e.which) {
        // Netscape/Firefox/Opera
        that.nextCode = e.which;
      }
      if (e.which === 13) {
        if (that.code.length < 3) return; // 手动输入的时间不会让code的长度大于2，所以这里只会对扫码枪有
        if(!that.intervalFlag) {
          Toast.clear();
          if(that.optType == 1) {   //==2 不移除
            window.removeEventListener("keydown", that.onClickKeydown);
          }

          let scanResult = that.code.replace(/Shift/g, "");    //扫码结果
          that.$refs.viewProcessRef.focus();
          if (!that.$validURL(scanResult) && isNaN(Number(scanResult))) {
            that.$toast.fail("请扫生产码 或者 落布码");
            return false;
          }

          //非链接的为坯布id
          if(scanResult.indexOf("http://") == -1) {
            //获取坯布信息
            loadGreyCloth(scanResult, res => {
              if(that.optType == 2) {   //获取当个盘头数据
                that.curCraftByIdFn(that, res.craftId);
              } else {
                that.listCraftByDesignFn(that, res.designFormId, res.designNo);
              }
            });
          } else {
            let index = scanResult.indexOf("taskId=");
            let lastIndex = scanResult.indexOf("&craftId=");
            let taskId = scanResult.substr(index + 7, lastIndex == -1 ? scanResult.length - index - 7 : lastIndex - index - 7);
            loadCraftByTask({
              taskId: taskId
            }, res => {
              if(that.optType == 2) {      //获取当个盘头数据
                that.curCraftByIdFn(that, res.id);
              } else {
                that.listCraftByDesignFn(that, res.designFormId, res.designNo);
              }
            });
          }

          that.optType = 0;   //重置扫码操作标记
        } else {
          that.$toast.fail("扫码过于频繁");
        }

        that.code = "";
        that.lastCode = "";
        that.lastTime = "";
        return;
      }
      that.nextTime = new Date().getTime();
      if (!that.lastTime && !that.lastCode) {
        console.log("扫码开始。。。");
        that.code += e.key;
      }
      if (
          that.lastCode &&
          that.lastTime &&
          that.nextTime - that.lastTime > 500
      ) {
        // 当扫码前有keypress事件时,防止首字缺失
        console.log("防止首字缺失。。。");
        that.code = e.key;
      } else if (that.lastCode && that.lastTime) {
        console.log("扫码中。。。");
        that.code += e.key;
      }
      that.lastCode = that.nextCode;
      that.lastTime = that.nextTime;
    },
    queryNewest4CraftFn() {
      let that = this;
      that.listCraftByDesignFn(that, "", that.craftNameParam);
    },
    //查看最近
    listCraftByDesignFn(that, designId, designNo) {
      that.showCraftPop = false;
      that.craftNameParam = designNo;
      if(designId) {
        designNo = "";
      }
      that.craftData.splice(0, that.craftData.length);
      loadCraftByDesign({
        pageSize: 10000,
        designFormId: designId,
        designNo: designNo,
        beginAt: that.startDateParam,
        endAt: that.endDateParam
      }, res => {
        res.list.forEach(row => {
          that.craftData.push(row);
        })
      });
    },
    //查看当前一条
    curCraftByIdFn(that, craftId) {
      if(that.craftData.findIndex(row => row.id == craftId) != -1) {
        that.$toast.fail("织造数据已存在");
        return;
      }
      loadCraftById(craftId, res => {
        that.craftData.push(res);
      });
    },
    //选中织造行
    selectCraftRowFn(row, index) {
      let that = this;
      that.curCraftRowIndex = index;
      that.showStepOverlay = true;

      that.stepData.splice(0, that.stepData.length);
      loadTaskStepList({
        pageSize: 10000,
        taskId: row.taskId
      }, res => {
        res.list.forEach(step => {
          step.craftId = row.id
          that.stepData.push(step);
        });
      });
    },
    //选中环节行
    selectStepRowFn(step, index) {
      let that = this;
      that.curStepRowIndex = index;
      if(step.stepType == 1) {
        that.showOptOverlay = true;
        that.optData.splice(0, that.optData.length);
        //加载数据
        loadOptDataByStep({
          stepId: step.id
        }, res => {
          res.items.forEach(item => {
            item.id = randomStr();
            that.optData.push(item);
          });
        });
      } else if(step.stepType == 2) {
        that.showGreClothOverlay = true;
        that.greyClothData.splice(0, that.greyClothData.length);
        //加载坯布
        loadGreyClothByCraft({
          id: step.craftId
        }, res => {
          res.forEach(greyCloth => {
            that.greyClothData.push(greyCloth);
          })
        });
      }
    },
    //关闭环节
    closeStepOverlayFn() {
      let that = this;
      that.showStepOverlay = false;
      that.curStepRowIndex = -1;
      that.showOptOverlay = false;
      that.showGreClothOverlay = false;
    },
    //关闭操作数据
    closeOptOverlayFn() {
      let that = this;
      that.showOptOverlay = false;
    },
    //关闭坯布数据
    closeGreyClothOverlayFn() {
      let that = this;
      that.showGreClothOverlay = false;
    }
  }
}
</script>

<style lang="scss">
.view-process {
  position: relative;
  top: 0;
  //导航栏样式
  .van-nav-bar {
    height: 60px;
    .van-icon {
      width: 50px;
      height: 50px;
    }
    .van-nav-bar__right {
      margin-top: 5px;
    }
    .van-button-nav {
      font-size: 28px;
      width: 150px;
    }
  }

  //弹窗样式
  .van-popup {
    &.login-popup__filter {
      width: 30%;
      height: 50%;
      overflow: hidden;
      .van-popup__close-icon {
        position: fixed !important;
        right: 10px !important;
        top: 10px !important;
      }
    }
  }

  //织造工艺表格样式
  .craft-row {
    border-left: #323233 1px solid;
    line-height: 38px;
    height: 38px;
    &.selected {
      background-color: #e6a23c;
    }
    &.first {
      border-top: #323233 1px solid;
    }
    &.selected-cur {
      background-color: #e6a23c;
    }
  }
  .craft-row-col {
    text-align: center;
    font-size: large;
    height: 38px;
    overflow: hidden;
    flex: 1;
    border-right: #323233 1px solid;
    border-bottom: #323233 1px solid;
    &.title {
      font-weight: bolder;
    }
    &.dateTime {
      flex: 0 0 240px;
    }
    &.userName {
      flex: 0 0 120px;
    }
    &.colorNo {
      flex: 0 0 200px;
    }
    &.number {
      flex: 0 0 80px;
    }
    &.opt {
      flex: 0 0 100px;
    }
  }
}
</style>